<include file="Public/head" title="充值"/>
<include file="Public/back_head"/>
<div class="main">
    <div class="recharge">
        <div class="money">
            <span>充值金额</span>
            <label for="">
                <input type="number" placeholder="请输入充值金额" name="money">
            </label>
        </div>
        <button class="save_btn">充值</button>
    </div>
</div>
<include file="Public/payapi"/>
<script>
$('.save_btn').one('click',function(){
   var total_fee = $('input[name=money]').val();
   if(total_fee ==''){
	   layer.msg('请输入充值金额');
	   return false;
   }
   var url = "{:U('Pay/recharge')}";
   to_pay(url,total_fee,function(res){
		if(res.errMsg == "chooseWXPay:ok" ) {
		   layer.msg('充值成功');
		   location.href="{:U('User/account')}";
		}else{
			layer.msg('充值失败');
			window.location.reload();
		}
   });
   return false;
});
</script>
<include file="Public/foot"/>